package com.genexususa.eo.bing.data.wsSubclasses;

import com.genexususa.eo.bing.CampaignManagementServiceClasses.ProductCondition;
import com.genexususa.eo.bing.CampaignManagementServiceClasses.ProductConditionCollection;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

public class GxProductConditionCollection extends ProductConditionCollection {
    public GxProductConditionCollection(Element element) {
        NodeList conditionsNode = element.getElementsByTagName("ProductConditionCollection");
        if (conditionsNode.getLength() > 0) {
            NodeList productConditionNode = ((Element)conditionsNode.item(0)).getElementsByTagName("ProductCondition");
            ProductCondition[] productConditions = new ProductCondition[productConditionNode.getLength()];
            for (int temp = 0; temp < productConditionNode.getLength(); temp++) {
                productConditions[temp] = new GxProductCondition((Element)productConditionNode.item(temp));
            }
            this.setConditions(productConditions);
        }
    }
}
